
function navigateWithToken(path: string): void {
  const token: string | null = localStorage.getItem('Admin-Token');
  if (!token) {
    console.error('Token not found in localStorage.');
    return;
  }

  const baseUrl: string = 'http://61.163.6.208:8891';

  const fullUrl = `${baseUrl}${path}?token=${encodeURIComponent(token)}&openDoor=1`;
  // 打开新窗口或标签页
  window.open(fullUrl, '_blank'); // 使用'_blank'确保始终打开新的标签页
}


function jiatingYishengToken(path: string): void {
  const token: string | null = localStorage.getItem('Admin-Token');
  if (!token) {
    console.error('Token not found in localStorage.');
    return;
  }
  const clientid = 'e5cd7e4891bf95d1d19206ce24a7b32e';
  const baseUrl: string = 'http://61.163.6.208:8893';

  const fullUrl = `${baseUrl}${path}?ref=addtabs&authorization=Bearer ${encodeURIComponent(token)}&clientid=${clientid}`;
  // 打开新窗口或标签页
  window.open(fullUrl, '_blank'); // 使用'_blank'确保始终打开新的标签页
}



export {
  navigateWithToken,
  jiatingYishengToken
};
